package com.leetcode.algorithm.y22.m08.w1;

import java.util.ArrayList;
import java.util.List;

/**
 * 1408. 数组中的字符串匹配
 * 
 * https://leetcode.cn/problems/string-matching-in-an-array/
 * 
 * @author jie.deng
 *
 */
class Question1408Solution01 {
	
	public List<String> stringMatching(String[] words) {
		List<String> list = new ArrayList<>();
		for (String word : words) {
			for (String str : words) {
				if (word.length() < str.length() && str.contains(word)) {
					list.add(word);
					break;
				}
			}
		}
		return list;
	}
    
}